package com.cloud.sso.web;

import com.cloud.sso.common.config.SSOProperty;
import com.cloud.sso.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {

    @Autowired
    private SSOProperty ssoProperty;

    @Autowired
    private RoleService roleService;

    @RequestMapping("/login")
    public String loginPage() {
        return "redirect:" + ssoProperty.getLoginUrl();
    }

    @RequestMapping("/exception")
    public String exception(){
        roleService.query(null, null);
        return null;
    }
}
